gtk-demo: Fix keynav in the puzzle demo
authorMatthias Clasen <mclasen@redhat.com>
Thu, 6 Aug 2020 00:52:22 +0000 (20:52 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 6 Aug 2020 00:52:22 +0000 (20:52 -0400)
Fixes: #3023
demos/gtk-demo/sliding_puzzle.c

index bff400b6c458b383a1cd3b5e187f08d5d3ccaab0..250f5983cfcc9c49e806e7f7cd40f9cacf9a7c7e 100644 (file)
@@ -272,7 +272,7 @@ start_puzzle (GdkPaintable *paintable)
 
   /* Create a new grid */
   grid = gtk_grid_new ();
-  gtk_widget_set_can_focus (grid, TRUE);
+  gtk_widget_set_focusable (grid, TRUE);
   gtk_aspect_frame_set_child (GTK_ASPECT_FRAME (frame), grid);
   aspect_ratio = gdk_paintable_get_intrinsic_aspect_ratio (paintable);
   if (aspect_ratio == 0.0)
@@ -284,7 +284,7 @@ start_puzzle (GdkPaintable *paintable)
    * keys to move the puzzle */
   controller = gtk_shortcut_controller_new ();
   gtk_shortcut_controller_set_scope (GTK_SHORTCUT_CONTROLLER (controller),
-                                     GTK_SHORTCUT_SCOPE_GLOBAL);
+                                     GTK_SHORTCUT_SCOPE_LOCAL);
   add_move_binding (GTK_SHORTCUT_CONTROLLER (controller),
                     GDK_KEY_Left, GDK_KEY_KP_Left,
                     -1, 0);